# -*- coding: utf-8 -*- #
"""
项目配置文件
APPLICATION_SETTINGS为应用配置参数
"""

import os
import sys
from tornado_jinja2 import Jinja2Loader
from tornado.options import options
abspath = os.path.dirname(__file__)
sys.path.append(abspath)
os.chdir(abspath)
print 'options.env:{env},options.port:{port}'.format(env=options.env, port=options.port)
env = options.env

MYSQL_APP_HOST = '47.92.112.59'
MYSQL_APP_DBNAME = 'qicheng'
MYSQL_APP_USERNAME = 'qic'
MYSQL_APP_PASSWORD = 'qic2017.,/'

MYSQL_DB_PORT = 3306

# 服务器图片保存目录
IMG_BASE_PATH = u'/usr/share/nginx/static/img/'
IMG_BASE_URL = 'http://app.qcjkjg.com/media/img/'

IS_CHECK_SIGN = False  # checksign方法中是否验证签名

# 客户端app连接配置
mysql_conn_app_dict = dict(host=MYSQL_APP_HOST, port=3306,
                           user=MYSQL_APP_USERNAME,
                           pwd=MYSQL_APP_PASSWORD,
                           db=MYSQL_APP_DBNAME, charset='utf8',
                           max_idle_connections=10,
                           max_open_connections=100, max_recycle_sec=3)


APPLICATION_SETTINGS = dict(
    debug=True,
    cookie_secret='random key',
    login_url='/login',
    template_loader=Jinja2Loader('./templates/'),
    static_path=os.path.join(os.path.dirname(__file__), 'static')
)
